﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Jayrock.Json;
using BLL;

namespace SilkRoute.Class
{
    public partial class insertProfileLocationInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string ip = Request["ip"].ToString();
            string countryCode = Request["countryCode"].ToString();
            string countryName = Request["countryName"].ToString();
            string regionName = Request["regionName"].ToString();
            string city = Request["city"].ToString();
            string latitude = Request["latitude"].ToString();
            string longitude = Request["longitude"].ToString();
            string continentName = Request["continentName"].ToString();
            Int32 profileId = Convert.ToInt32(Request["profileId"].ToString());

            ProfileManager manager = new ProfileManager();
            Int32 result = manager.InsertProfileLocationInfo(ip, countryCode, countryName, regionName, city, latitude, longitude, continentName, profileId);

            JsonObject jObj = new JsonObject();
            if (result > 0)
            {
                jObj["result"] = result;
            }
            else
            {
                jObj["result"] = "0";
            }

            Response.Write(jObj);

        }
    }
}